/**
 * @class UI-基础件-尺度条
 * @author DuskyHuang 圣子
 * @description 包含视野尺度显示
*/

import { _decorator, Node, Vec3 } from 'cc';
import { Mediator } from 'cfw';
import { cosmos } from 'proxies';
const { ccclass, property } = _decorator;


@ccclass('cocosmos.scale-bar')
export class ScaleBar extends Mediator {

    @property(Node) public handle: Node;
    protected start(): void {
        v3a.set(this.handle.position);
    }

    protected update(): void {
        v3a.y = cosmos.pow10 * UNIT_2_PX + OFFSET_ZERO;
        this.handle.setPosition(v3a);
    }

}

const UNIT_2_PX: num.px = -18.5;
const OFFSET_ZERO: num.px = -41;

const v3a = new Vec3;